package com.chen.service.impl;

import com.chen.entity.Goods;
import com.chen.entity.User;
import com.chen.mapper.GoodsMapper;
import com.chen.mapper.UserMapper;
import com.chen.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    @Transactional(readOnly = true)
    public List<Goods> selectAll() {
        List<Goods> goodsList = goodsMapper.selectAll();
        return goodsList;
    }

    @Override
    public Integer insertGoods(Goods goods) {
        return goodsMapper.insertUser(goods);
    }

    @Override
    public Integer updateById(Goods goods) {
        return goodsMapper.updateById(goods);
    }

    @Override
    public Integer deleteById(Long id) {
        return goodsMapper.deleteById(id);
    }
}
